﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;
using System.Web.Security;
using DLM.Web.MVC.Models;
using DLM.Domain.Model;
using DLM.Services.Interfaces;
using DLM.Web.ViewModel;
using Microsoft.Web.Helpers;
using Webdiyer.WebControls.Mvc;
using DLM.Infrastructure.Security;
using DLM.Services.Implementations;
using DLM.Infrastructure.Email;
using DLM.Web.MVC.Extensions;


namespace DLM.Web.MVC.Controllers
{
    public class CommonController : Controller
    {
        [HttpGet]
        public ActionResult FindProvince()
        {
            var data = PageDataService.ShowProvince();

            return Json(data, JsonRequestBehavior.AllowGet);
        }

        [HttpGet]
        public ActionResult FindCity(string province)
        {
            if (Request.IsAjaxRequest())
            {
                var data = PageDataService.ShowCity(province);

                return Json(data, JsonRequestBehavior.AllowGet);
            }
            return Content("");

        }

        [HttpGet]
        public ActionResult FindZone(string city)
        {
            if (Request.IsAjaxRequest())
            {
                var data = PageDataService.ShowDistrict(city);

                return Json(data, JsonRequestBehavior.AllowGet);
            }
            return Content("");
        }

    }
}
